package com.doit.demo03;

public class Signal {
    //懒汉式
    private static Signal s;

    //方法私有
    private Signal(){}

    //获取s
    public static Signal getSignal()
    {
        if(s==null)
        {
            synchronized (Signal.class)
            {
                if(s==null)
                {
                    s=new Signal();
                }
            }
        }
        return s;
    }
}
